# 定义类
class Student:
    name = '张三'
    age = 18

# 使用类,创建对象
zhansan = Student()

zhansan.age = 20
print(zhansan.age)
print(zhansan.name)
print('------------------------')

lisi = Student()
print(lisi.name)

lisi.name = '李四'
print(lisi.age)
print(lisi.name)
print('------------------------')

Student.name = '李四'
wangwu = Student()
print(wangwu.name)
print('------------------------')

class Phone:
    brand = '苹果'
    price = 10000
    type = 'iPhone 13'

    def call(self):
        print('self-->',self)
        # print('正在访问通讯录：') #err
        # for person in self.address_book:
        #     print(person.items())
        print('正在打电话...')
        print('留言：', self.note)

phone1 = Phone()
phone1.note = '我是phone1的note'
phone1.address_book = [{'128326939':'张三'},{'889697699':'李四'}]
print(phone1,'------>1')
phone1.call() #call(phone1) --> self.note


print('*****')

phone2 = Phone()
phone2.note = '我是phone222的note'
print(phone2,'------>2')
phone2.call() #call(phone2) --> self.note





